Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] handle case where instance already exists #563

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

rahulait
Copy link
Collaborator

@rahulait rahulait commented Nov 7, 2024

What this PR does / why we need it:
If create instance call fails due to context timeout error, instance gets provisioned on the linode side but CAPL thinks instance is still not created. It keeps on retrying and ends up hitting [400 label must be unique] error as it cannot provision another instance with same name. This results in CAPL continuously retrying to create the instance and ending up hitting rate-limits. This PR fixes the issue by doing a GET if instance already exists and using it during next reconciles.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@rahulait rahulait force-pushed the fix-instance-already-exist-error branch 2 times, most recently from 4205c90 to f1eb5ed Compare November 7, 2024 08:50
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.

Project coverage is 64.84%. Comparing base (9c9b3ac) to head (4944970).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
controller/linodemachine_controller_helpers.go 63.15% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #563      +/-   ##
==========================================
- Coverage   64.84%   64.84%   -0.01%     
==========================================
  Files          79       79              
  Lines        5664     5683      +19     
==========================================
+ Hits         3673     3685      +12     
- Misses       1718     1723       +5     
- Partials      273      275       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rahulait rahulait force-pushed the fix-instance-already-exist-error branch from f8d18f9 to 3812bb9 Compare November 7, 2024 15:00
@rahulait rahulait force-pushed the fix-instance-already-exist-error branch 2 times, most recently from a44e517 to 2e94207 Compare November 7, 2024 17:07
AshleyDumaine
AshleyDumaine previously approved these changes Nov 7, 2024
Copy link
Member

@AshleyDumaine AshleyDumaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AshleyDumaine AshleyDumaine changed the title handle case where instance already exists [fix] handle case where instance already exists Nov 7, 2024
komer3
komer3 previously approved these changes Nov 7, 2024
@rahulait rahulait dismissed stale reviews from komer3 and AshleyDumaine via b0e3b28 November 8, 2024 00:07
@rahulait rahulait force-pushed the fix-instance-already-exist-error branch from b0e3b28 to 4944970 Compare November 8, 2024 00:07
@rahulait rahulait merged commit b92b301 into main Nov 8, 2024
11 of 13 checks passed
@rahulait rahulait deleted the fix-instance-already-exist-error branch November 8, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants